using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Inventory
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("库存管理")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("库存调整")]
  public partial class InventoryAdjustment : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private System.String _remark;
    private System.String _transferringReason;
    private System.DateTime _transferringDate;
    private Ascent.QiPei.Module.BusinessObjects.Base.Employee _employee;
    private Ascent.QiPei.Module.BusinessObjects.Enums.InvAdujstmentType _inventoryAdustmentType;
    private System.String _fADCode;
    public InventoryAdjustment(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("单号")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String FADCode
    {
      get
      {
        return _fADCode;
      }
      set
      {
        SetPropertyValue("FADCode", ref _fADCode, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调仓类型")]
    [RuleRequiredField(DefaultContexts.Save)]
    public Ascent.QiPei.Module.BusinessObjects.Enums.InvAdujstmentType InventoryAdustmentType
    {
      get
      {
        return _inventoryAdustmentType;
      }
      set
      {
        SetPropertyValue("InventoryAdustmentType", ref _inventoryAdustmentType, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("经办人")]
    public Ascent.QiPei.Module.BusinessObjects.Base.Employee Employee
    {
      get
      {
        return _employee;
      }
      set
      {
          SetPropertyValue("Employee", ref _employee, value);
        //if (_employee == value)
        //  return;
        //Ascent.QiPei.Module.BusinessObjects.Base.Employee prevEmployee = _employee;
        //_employee = value;
        //if (IsLoading)
        //  return;
        //if (prevEmployee != null && prevEmployee.InventoryAdjustment == this)
        //  prevEmployee.InventoryAdjustment = null;
        //if (_employee != null)
        //  _employee.InventoryAdjustment = this;
        //OnChanged("Employee");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调整日期")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.DateTime TransferringDate
    {
      get
      {
        return _transferringDate;
      }
      set
      {
        SetPropertyValue("TransferringDate", ref _transferringDate, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("调整原因")]
    public System.String TransferringReason
    {
      get
      {
        return _transferringReason;
      }
      set
      {
        SetPropertyValue("TransferringReason", ref _transferringReason, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    public System.String Remark
    {
      get
      {
        return _remark;
      }
      set
      {
        SetPropertyValue("Remark", ref _remark, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("InventoryAdjustmentItemses-InventoryAdjustment")]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("明细")]
    public XPCollection<Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryAdjustmentItems> InventoryAdjustmentItemses
    {
      get
      {
        return GetCollection<Ascent.QiPei.Module.BusinessObjects.Inventory.InventoryAdjustmentItems>("InventoryAdjustmentItemses");
      }
    }
  }
}
